/*
 *  IMIBaseAppHelper.h
 *  IMIBase
 *
 *  Created by Travis on 09-7-12.
 *  Copyright 2009 imi.im All rights reserved.
 *
 */
#import "IMIBasePrefix.h"

/** return app main bundle path as nsstring
 */
IMIDefine NSString*
AppDir(){
	return [[NSBundle mainBundle] resourcePath];
}

/** return app documents folder path as nsstring
 */
IMIDefine NSString*
DocDir(){
	NSArray	*documentPaths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	return [documentPaths  objectAtIndex:0];
}

/** return the full path of file in folder
 *	arguments:
 *		name: file name
 *		folder: the folder of file
 */
IMIDefine NSString*
Resource(NSString* name, NSString* folder){
	NSString *folderPath=[AppDir() stringByAppendingPathComponent:folder];
	return [folderPath stringByAppendingPathComponent:name];
}

IMIDefine BOOL 
FileExistAt(NSString *filepath)
{
	if(filepath==nil)return NO;
	return [[NSFileManager defaultManager] fileExistsAtPath:filepath];
}
#define AppSetting [NSUserDefaults standardUserDefaults]

@interface UIApplication (IMIBase)

//show current project version number on screen
+ (void) showSVNVersion;

@end
